<!-- <link rel="stylesheet" type="text/css" href="assets/bootstrap-datepicker/css/bootstrap-datetimepicker.min.css" /> -->
<link rel="stylesheet" type="text/css" href="assets/bootstrap-datepicker/css/datepicker.css" />
<div class="form-group customerForm">
    <label class="col-sm-2 control-label">文件分类</label>
    <div class="col-sm-10">
        <select ng-model="file.classCategoriesCode" class="form-control" certus-required-polyfill
            ng-change="categoryChange()" ng-disabled="classCateCodeDis">
            <option ng-repeat="x in file.classCategoriesCodeSelect" value="{{x.fileCategoriesCode}}">
                {{x.fileCategoriesName}}
            </option>
        </select>
    </div>
</div>
<div class="form-group customerForm">
    <label class="col-sm-2 control-label">文件类型</label>
    <div class="col-sm-10">
        <select ng-model="file.fileClassCode" class="form-control" certus-required-polyfill id="fileType"
            ng-disabled="fileClassCodeDis">
            <option ng-repeat="x in file.fileClassCodeSelect" value="{{x.fileClassCode}}">
                {{x.fileClassName}}
            </option>
        </select>
    </div>
</div>
<div class="form-group customerForm">
    <label class="col-sm-2 control-label">文件名</label>
    <div class="col-sm-10">
        <input type="text" value="" ng-model="file.fileName"  maxlength="20"  certus-required-polyfill
            id="fileName" class="form-control" placeholder="请在文件名后，加上版本号（字数限制20字以内）">
    </div>
</div>
<div class="form-group customerForm">
    <label class="col-sm-2 control-label">文件说明</label>
    <div class="col-sm-10">
        <textarea class="form-control" ng-model="file.fileDesc"  maxlength="120"  id="fileDesc"></textarea>
    </div>
</div>
<div class="form-group customerForm">
    <label class="col-sm-2 control-label">文件有效期</label>
    <div class="col-sm-10">
        <input id="datetimeFile" type="text" ng-model="file.validity" class="form-control">
    </div>
</div>
<div class="form-group customerForm">
    <label class="col-sm-2 control-label">文件密级</label>
    <div class="col-sm-10">
        <select ng-model="file.classFictionCode" certus-required-polyfill class="form-control"
            ng-change="classChange()">
            <option ng-repeat="x in file.classfictionselect" value="{{x.value}}">
                {{x.name}}
            </option>
        </select>
    </div>
</div>
<div class="form-group customerForm" ng-show="fileview.semiopen">
    <label class="col-sm-2 control-label">文件管理员</label>
    <div class="col-sm-10">
        <input type="text" list="browsers1" value="" ng-model="file.fileManager1" certus-required-polyfill
            class="form-control" placeholder="自动检索，查询结果较多时候，系统不显示，需要尽量多输入相关字段">
        <datalist id="browsers1">
            <option ng-repeat="x in userSelect1" value="{{x.userName}}">
        </datalist>
    </div>
</div>
<div class="form-group customerForm" ng-show="fileview.disclosure">
    <label class="col-sm-2 control-label">下载审批人</label>
    <div class="col-sm-10">
        <input type="text" value="" list="browsers2" ng-model="file.uploaderLeader1" certus-required-polyfill
            class="form-control" placeholder="自动检索，查询结果较多时候，系统不显示，需要尽量多输入相关字段">
        <datalist id="browsers2" ng-model="selected">
            <option ng-repeat="x in userSelect2" value="{{x.userName}}">
        </datalist>
    </div>
</div>
<div class="form-group customerForm">
    <label class="col-sm-2 control-label">文件上传</label>
    <div class="col-sm-10">
        <input type="file" class="form-control input-file" certus-required-polyfill="" id="fileUploadId">
    </div>
</div>
<div class="form-group customerForm">
    <p class="col-sm-12 file-msg">
        注意事项：<br />
        1、当选择“外部保密”时候，如果使用者需要下载，则需要得到需要下载的人员的部门领导审批后才能下载；<br />
        2、当选择“内部保密”时候，如果使用者需要下载，则需要得到需要下载的人员的部门领导审批后，然后得到文件制定的审批人审批通过后才能下载；<br />
        3、文件类型目前只支持选择doc、docx、txt、pdf、jpg、rar等类型；<br />
        4、文件上传大小只支持不超过50M的文件；<br />
        5、禁止上传研发内部设计文档（对外的技术支持、产品概述等外部使用文档可以上传），研发内部文档由SVN管理。<br />
    </p>
</div>
<!-- <script type="text/javascript" src="assets/bootstrap-datepicker/js/bootstrap-datetimepicker.js"></script> -->
<script type="text/javascript" src="assets/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script>
    //初始化 时间 控件
    // var picker2 = $('#datetimeFile').datetimepicker({
    //     format: 'YYYY-MM-DD',
    //     locale: moment.locale('zh-cn')
    // }).on('dp.change', function (e) {
    //     var result = new moment(e.date).format('YYYY-MM-DD');
    //     if (result && !angular.isUndefined(result)) {
    //         if (!$$scope.file) {
    //             $$scope.file = {};
    //         }
    //         $$scope.file.validity = result;
    //         console.log(result);
    //         $$scope.$apply();
    //     }
    // })
    var picker2 = $('#datetimeFile').datepicker({
        format: 'yyyy-mm-dd',
        locale: moment.locale('zh-cn')
    }).on('dp.change', function (e) {
        var result = new moment(e.date).format('yyyy-mm-dd');
        if (result && !angular.isUndefined(result)) {
            //            if (!$$scope.file) {
            //                $$scope.file = {};
            //            }
            $$scope.file.validity = result;
            console.log(result);
            $$scope.$apply();
        }
    })
</script>